let versionData = require('../../static/version.json');

const isNewVersion = () => {
  let version = versionData.version;
  let localVersion = localStorage.getItem('version');
  if (localVersion && localVersion != version) {
    localStorage.setItem('version', versionData.version);
    let clearVersion = versionData.version;
    let haveClear = localStorage.getItem(clearVersion);
    if (haveClear != true) {
      window.localStorage.clear();
      localStorage.setItem(versionData.version, true);
    }
  } else {
    localStorage.setItem('version', versionData.version);
  }
};
export default {
  isNewVersion
}
